package com.itheima.homework;

import java.util.Scanner;
public class Test6 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个小数:");
        double a = sc.nextDouble();
        System.out.println(a + "的绝对值为" + value(a));
    }
    public static double value(double a) {
        if (a >= 0) {
            a = a;
        } else {
            a = a * -1;
        }
        return a;
    }
}
